package com.example.lock.component.lock.autoconfigure;


import com.example.lock.component.lock.executor.RedissonLockExecutor;
import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;

/**
 * @Description: Redisson锁自动配置器
 * @author: sun
 * @date: 2022.01.17
 */
@Configuration
@ConditionalOnClass(Redisson.class)
class RedissonLockAutoConfiguration {
    @Bean
    @Order(100)
    public RedissonLockExecutor redissonLockExecutor(RedissonClient redissonClient) {
        return new RedissonLockExecutor(redissonClient);
    }
}
